/**
 * @Title: 金融申请状态枚举类
 * 1:申请中
 * 2:初审通过
 * 3:初审不通过
 * 4:复审通过
 * 5:复审不通过
 * @author
 * @date 2018年5月7日
 */

package com.wishu.finance.enums;

public enum FinanceApplyStateEnum {


    SHZ("待审核", 1),    //申请中
    CSPASS("初审通过(待复审)", 2),    //初审通过
    CSNOPASS("初审不通过", 3), //初审不通过
    FSPASS("复审通过", 4),    //复审通过
    FSNOPASS("复审不通过", 5);    //复审不通过


    private String name;
    private int index;

    private FinanceApplyStateEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (FinanceApplyStateEnum c : FinanceApplyStateEnum.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    public static Integer getIndex(String name) {
        for (FinanceApplyStateEnum c : FinanceApplyStateEnum.values()) {
            if (c.getName().equals(name)) {
                return c.getIndex();
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
